<template>
  <div class="app-container" style="overflow: scroll">
    <div style="width: 1024px; margin: 0 auto">
      <el-form ref="submitParams" :model="submitParams" :rules="rules" label-width="150px">
        <el-row type="flex">
          <el-col :span="12">
            <el-form-item label="发起参与机构" prop="sender">
              <el-input v-model="submitParams.sender" :disabled="true" />
            </el-form-item>
          </el-col>

          <el-col :span="12">
            <el-form-item label="发起参与机构名" prop="senderName">
              <el-input v-model="submitParams.senderName" :disabled="true" />
            </el-form-item>
          </el-col>
        </el-row>

        <el-row type="flex">
          <el-col :span="12">
            <el-form-item label="接收行行号" prop="indirectRecver">
              <el-input v-model="submitParams.indirectRecver" @change="checkbankcode('indirectRecver')" />
            </el-form-item>
          </el-col>
          <el-col :span="6">
            <el-form-item label-width="20px">
              <el-button icon="el-icon-search" plain type="primary" @click="openBankBranchDialog('indirectRecver')">
                行名行号查询
              </el-button>
            </el-form-item>
          </el-col>
        </el-row>

        <el-row type="flex">
          <el-col :span="18">
            <el-form-item label="接收行行名" prop="indirectRecverName">
              <el-input v-model="submitParams.indirectRecverName" :disabled="true" />
            </el-form-item>
          </el-col>
        </el-row>

        <el-row type="flex">
          <el-col :span="24">
            <el-form-item label="备注" prop="remark">
              <el-input type="textarea" v-model="submitParams.remark" maxlength="256" show-word-limit />
            </el-form-item>
          </el-col>
        </el-row>

        <el-row type="flex">
          <el-col :span="12">
            <el-form-item label="费用标识" prop="feeId">
              <el-select style="width: 100%" v-model="submitParams.feeId" placeholder="费用标识">
                <el-option
                  v-for="dict in dictMap.FEE_ID"
                  :key="dict.value"
                  :label="`${dict.value}-${dict.text}`"
                  :value="dict.value"
                ></el-option>
              </el-select>
            </el-form-item>
          </el-col>

          <el-col :span="12">
            <el-form-item label="统一社会信用代码" prop="uniformScCode">
              <el-input v-model="submitParams.uniformScCode" />
            </el-form-item>
          </el-col>
        </el-row>

        <el-row type="flex">
          <el-col :span="24">
            <el-form-item label="客户标识" prop="custId">
              <el-input type="textarea" v-model="submitParams.custId" maxlength="256" show-word-limit/>
            </el-form-item>
          </el-col>
        </el-row>

        <el-row type="flex">
          <el-col :span="12">
            <el-form-item label="客户标识类型" prop="custType">
              <el-select style="width: 100%" v-model="submitParams.custType" placeholder="客户标识类型">
                <el-option
                  v-for="dict in dictMap.Cust_Identy_Type_Code"
                  :key="dict.value"
                  :label="`${dict.value}-${dict.text}`"
                  :value="dict.value"
                ></el-option>
              </el-select>
            </el-form-item>
          </el-col>

          <el-col :span="12">
            <el-form-item label="特约委收种类代码" prop="spTypeCode">
              <el-input v-model="submitParams.spTypeCode" />
            </el-form-item>
          </el-col>
        </el-row>

        <el-row type="flex">
          <el-col :span="12">
            <el-form-item label="账期区间" prop="billDate">
              <el-input v-model="submitParams.billDate" />
            </el-form-item>
          </el-col>

          <el-col :span="12">
            <el-form-item label="欠缴类型" prop="arrearsType">
              <el-select style="width: 100%" v-model="submitParams.arrearsType" placeholder="欠缴类型">
                <el-option
                  v-for="dict in dictMap.Arrears_Type_Code"
                  :key="dict.value"
                  :label="`${dict.value}-${dict.text}`"
                  :value="dict.value"
                ></el-option>
              </el-select>
            </el-form-item>
          </el-col>
        </el-row>

        <el-row type="flex">
          <el-col :span="12">
            <el-form-item label="缴款渠道" prop="paymentType">
              <el-select style="width: 100%" v-model="submitParams.paymentType" placeholder="缴款渠道">
                <el-option
                  v-for="dict in dictMap.Pay_Code"
                  :key="dict.value"
                  :label="`${dict.value}-${dict.text}`"
                  :value="dict.value"
                ></el-option>
              </el-select>
            </el-form-item>
          </el-col>

          <el-col :span="12">
            <el-form-item label="缴款查询类型" prop="paymentInqType">
              <el-select style="width: 100%" v-model="submitParams.paymentInqType" placeholder="缴款查询类型">
                <el-option
                  v-for="dict in dictMap.Pay_Query_Type_Code"
                  :key="dict.value"
                  :label="`${dict.value}-${dict.text}`"
                  :value="dict.value"
                ></el-option>
              </el-select>
            </el-form-item>
          </el-col>
        </el-row>

        <el-row type="flex">
          <el-col :span="12">
            <el-form-item label="地域标识" prop="regionid">
              <el-input v-model="submitParams.regionid" @change="getbase('RegionId')" />
            </el-form-item>
          </el-col>

          <el-col :span="12">
            <el-input v-model="submitParams.regionidDesc" :disabled="true" />
          </el-col>

          <el-col :span="6">
            <el-form-item label-width="20px">
              <el-button icon="el-icon-search" plain type="primary" @click="openBasedataDialog('RegionId')">
                请选择
              </el-button>
            </el-form-item>
          </el-col>
        </el-row>

        <el-row type="flex">
          <el-col :span="24">
            <el-form-item label="附言" prop="addInfo">
              <el-input type="textarea" v-model="submitParams.addInfo" maxlength="256" show-word-limit/>
            </el-form-item>
          </el-col>
        </el-row>

        <el-row type="flex">
          <el-col :span="12">
            <el-form-item label="票据业务类型" prop="billType">
              <el-input v-model="submitParams.billType" />
            </el-form-item>
          </el-col>

          <el-col :span="12">
            <el-form-item label="票面校验信息" prop="billChkInfo">
              <el-input v-model="submitParams.billChkInfo" />
            </el-form-item>
          </el-col>
        </el-row>

        <el-row type="flex">
          <el-col :span="12">
            <el-form-item label="险种代码" prop="insuranceCode">
              <el-input v-model="submitParams.insuranceCode" :disabled="QT00disable" />
            </el-form-item>
          </el-col>

          <el-col :span="12">
            <el-form-item label="单位社保号码" prop="orgSocialId">
              <el-input v-model="submitParams.orgSocialId" :disabled="QT00disable" />
            </el-form-item>
          </el-col>
        </el-row>

        <el-row type="flex">
          <el-col :span="24">
            <el-form-item label="缴费人名称" prop="payerName">
              <el-input type="textarea" v-model="submitParams.payerName" :disabled="QT00disable" maxlength="120" show-word-limit />
            </el-form-item>
          </el-col>
        </el-row>

        <el-row type="flex">
          <el-col :span="12">
            <el-form-item label="缴费人证件类型" prop="payerIdType">
              <el-select
                style="width: 100%"
                v-model="submitParams.payerIdType"
                placeholder="缴费人证件类型"
                :disabled="QT00disable"
              >
                <el-option
                  v-for="dict in dictMap.Id_Type_Code"
                  :key="dict.value"
                  :label="`${dict.value}-${dict.text}`"
                  :value="dict.value"
                ></el-option>
              </el-select>
            </el-form-item>
          </el-col>

          <el-col :span="12">
            <el-form-item label="缴费人证件号码" prop="payerIdNo">
              <el-input v-model="submitParams.payerIdNo" :disabled="QT00disable" />
            </el-form-item>
          </el-col>
        </el-row>

        <el-row type="flex">
          <el-col :span="12">
            <el-form-item label="原报文标识号" prop="oriPkgId">
              <el-input v-model="submitParams.oriPkgId" :disabled="QT01disable" />
            </el-form-item>
          </el-col>

          <el-col :span="12">
            <el-form-item label-width="20px">
              <el-button
                icon="el-icon-search"
                plain
                type="primary"
                @click="opendetailQT00()"
                :style="{ display: visibleHiden }"
              >
                请选择
              </el-button>
            </el-form-item>
          </el-col>
        </el-row>

        <el-row type="flex">
          <el-col :span="12">
            <el-form-item label="原发起参与机构" prop="oriSender">
              <el-input v-model="submitParams.oriSender" :disabled="QT01disable" />
            </el-form-item>
          </el-col>

          <el-col :span="12">
            <el-form-item label="原报文类型" prop="oriMsgType">
              <el-input v-model="submitParams.oriMsgType" :disabled="QT01disable" />
            </el-form-item>
          </el-col>
        </el-row>

        <el-row type="flex">
          <el-col :span="12">
            <el-form-item label="征收机关代码" prop="orgId">
              <el-input v-model="submitParams.orgId" :disabled="QT02disable" />
            </el-form-item>
          </el-col>

          <el-col :span="12">
            <el-form-item label="纳税人编码" prop="taxPayerCode">
              <el-input v-model="submitParams.taxPayerCode" :disabled="QT02disable" />
            </el-form-item>
          </el-col>
        </el-row>

        <el-card class="form-card txnInfo-card">
          <div slot="header" class="label-header-msg">
            <span>账单信息明细</span>
          </div>

          <el-row type="flex">
            <el-col :span="12">
              <el-form-item label="账单信息数目" prop="billNum">
                <el-input v-model="submitParams.billNum" :disabled="true" />
              </el-form-item>
            </el-col>
          </el-row>

          <div v-if="this.submitParams.regionid !== '530100' && this.submitParams.feeId !== '06907'">
            <el-row type="flex">
              <el-col :span="12">
                <el-form-item label="账单编号" prop="billCode">
                  <el-input v-model="submitParams.billCode" />
                </el-form-item>
              </el-col>
            </el-row>

            <el-row type="flex">
              <el-col :span="12">
                <el-form-item label="账单金额币种" prop="billCurcd">
                  <el-input v-model="submitParams.billCurcd" />
                </el-form-item>
              </el-col>

              <el-col :span="12">
                <el-form-item label="账单金额" prop="billAmt">
                  <ht-amount-input v-model="submitParams.billAmt" placeholder="账单金额"></ht-amount-input>
                </el-form-item>
              </el-col>
            </el-row>
            <div class="discountReceipt-pick-operate-box">
              <div class="operate-box-bottom">
                <div class="bottom-content">
                  <ht-table
                    ref="dataTable"
                    :showSerialNumber="false"
                    :multi-select="false"
                    :opButtonList="opButtonList"
                    :tableBindColumns="tableBindColumns"
                    :showRightToolbar="false"
                    :randomRowKey="true"
                    :showPagination="false"
                  >
                    <template v-slot:operate>
                      <el-table-column
                        label="操作"
                        align="left"
                        width="120"
                        fixed="right"
                        class-name="small-padding fixed-width"
                      >
                        <template slot-scope="scope">
                          <ht-button-group
                            :buttonList="[
                          {
                            label: '删除',
                            doFunc: () => {
                              remove(scope.row, scope.$index);
                            },
                          },
                        ]"
                          />
                        </template>
                      </el-table-column>
                    </template>
                  </ht-table>
                </div>
              </div>
            </div>
            <el-row>
              <el-pagination
                background
                @size-change="handleSizeChange"
                @current-change="handleCurrentChange"
                :current-page="currentPage"
                :page-sizes="[10, 20, 30, 50]"
                :page-size="pageSize"
                layout="->,total, sizes, prev, pager, next, jumper"
                :total="detailList.length">
              </el-pagination>
            </el-row>
          </div>
        </el-card>
      </el-form>

      <div slot="footer" align="center" class="dialog-footer">
        <el-button type="primary" @click="submitForm">提 交</el-button>
        <el-button type="primary" @click="refresh">重 置</el-button>
      </div>

      <bank-branch-dialog ref="bankBranchDialog" @confirm="confirmBankBranch"></bank-branch-dialog>
      <base-data-dialog ref="basedataDialog" @confirm="confirmData"></base-data-dialog>
      <active-payment-management-message-entry-detail-q-t00-dailog
        ref="detailQT00Dialog"
        @confirm="confirmdetailQT00"
        :dictMap="this.dictMap"
        :formData.sync="this.formData"
      ></active-payment-management-message-entry-detail-q-t00-dailog>
    </div>
  </div>
</template>

<script>
import { listPageMixin } from "@/libs/listPageMixin";
import BankBranchDialog from "@/views/components/BankBranchDialog";
import { getBankInfByBankCode } from "@/api/cnaps/common/bankInfo";
import HtAmountInput from "@/views/components/HtAmountInput";
import { mapGetters } from "vuex";
import { amountThousandsFormatter } from "@/utils/table_col_formatter";
import BaseDataDialog from "@/views/components/BasedataDialog";
import { getBasedata } from "@/api/cnaps/common/basedata";
import ActivePaymentManagementMessageEntryDetailQT00Dailog from "@/views/cnaps/beps/361/components/active_payment_management_message_entry_detailQT00";
import { activePaymentManagementMessageEntrySave } from "@/api/cnaps/beps/361";

export default {
  name: "ActivePaymentManagementMessageEntry",
  mixins: [listPageMixin],
  components: { ActivePaymentManagementMessageEntryDetailQT00Dailog, BaseDataDialog, HtAmountInput, BankBranchDialog },

  data() {
    return {
      // 录入参数
      submitParams: {
        rspId: undefined,
        sender: undefined,
        senderName: undefined,
        indirectRecver: undefined,
        indirectRecverName: undefined,
        remark: undefined,
        feeId: undefined,
        uniformScCode: undefined,
        custId: undefined,
        custType: undefined,
        spTypeCode: undefined,
        billDate: undefined,
        arrearsType: undefined,
        paymentType: undefined,
        paymentInqType: undefined,
        regionid: undefined,
        regionidDesc: undefined,
        addInfo: undefined,
        billType: undefined,
        billChkInfo: undefined,
        insuranceCode: undefined,
        orgSocialId: undefined,
        payerName: undefined,
        payerIdType: undefined,
        payerIdNo: undefined,
        oriPkgId: undefined,
        oriMsgType: undefined,
        orgId: undefined,
        taxPayerCode: undefined,
        billNum: undefined,
        billCode: undefined,
        billCurcd: "CNY",
        billAmt: undefined,
        billInfo: [],
      },

      //前端分页参数
      currentPage: 1,
      pageSize: 20,
      detailList: [],

      formData: {},

      visibleHiden: "none",
      //判断字段只读
      QT00disable: true,
      QT01disable: true,
      QT02disable: true,

      loading: false,
      //
      searchFormDictList: [
        "FEE_ID",
        "Cust_Identy_Type_Code",
        "Arrears_Type_Code",
        "Pay_Code",
        "Pay_Query_Type_Code",
        "Id_Type_Code",
      ],

      tableBindColumns: [
        { prop: "billCode", label: "账单编号" },
        { prop: "billCurcd", label: "账单金额币种" },
        { prop: "billAmt", label: "账单金额", type: "price" },
      ],

      opButtonList: () => {
        return [
          {
            label: "新增",
            type: "primary",
            icon: "el-icon-plus",
            actionType: "add",
            clickFun: () => {
              this.addRow();
            },
          },
        ];
      },

      rules: {
        indirectRecver: [{ required: true, message: "请输入接收行行号", trigger: ['blur', 'change'] }],
        feeId: [
          { required: true, message: "请输入费用标识", trigger: "blur" },
          { max: 20, message: "长度最大为20位", trigger: "blur" },
        ],
        uniformScCode: [
          { required: true, message: "请输入统一社会信用代码", trigger: "blur" },
          { max: 18, message: "长度最大为18位", trigger: "blur" },
        ],
        custId: [
          { required: true, message: "请输入客户标识", trigger: "blur" },
          { max: 256, message: "长度最大为256位", trigger: "blur" },
        ],
        spTypeCode: [{ max: 6, message: "长度最大为6位", trigger: "blur" }],
        billDate: [{ max: 17, message: "长度最大为17位", trigger: "blur" }],
        regionid: [
          { required: true, message: "请输入地域标识", trigger: ['blur', 'change'] },
          { max: 6, message: "长度最大为6位", trigger: "blur" },
        ],
        billNum: [{ required: true, message: "请输入账单信息数目", trigger: "blur" }],
        addInfo: [{ max: 256, message: "长度最大为256位", trigger: "blur" }],
        billType: [
          { required: false, message: "请输入票据业务类型", trigger: "blur" },
          { max: 20, message: "长度最大为20位", trigger: "blur" },
        ],
        billChkInfo: [
          { required: false, message: "请输入票面校验信息", trigger: "blur" },
          { max: 20, message: "长度最大为20位", trigger: "blur" },
        ],
        insuranceCode: [
          { required: false, message: "请输入险种代码", trigger: "blur" },
          { max: 4, message: "长度最大为4位", trigger: "blur" },
        ],
        orgSocialId: [{ max: 35, message: "长度最大为35位", trigger: "blur" }],
        payerName: [{ max: 120, message: "长度最大为120位", trigger: "blur" }],
        payerIdNo: [{ max: 35, message: "长度最大为35位", trigger: "blur" }],
        oriPkgId: [
          { required: false, message: "请输入原报文标识号", trigger: "blur" },
          { max: 35, message: "长度最大为35位", trigger: "blur" },
        ],
        oriSender: [
          { required: false, message: "请输入原发起参与机构", trigger: "blur" },
          { max: 14, message: "长度最大为14位", trigger: "blur" },
        ],
        oriMsgType: [
          { required: false, message: "请输入原报文类型", trigger: "blur" },
          { max: 35, message: "长度最大为35位", trigger: "blur" },
        ],
        orgId: [
          { required: false, message: "请输入征收机关代码", trigger: "blur" },
          { max: 12, message: "长度最大为12位", trigger: "blur" },
        ],
        taxPayerCode: [
          { required: false, message: "请输入纳税人编码", trigger: "blur" },
          { max: 20, message: "长度最大为20位", trigger: "blur" },
        ],
        paymentInqType: [{ required: false, message: "请输入缴款查询类型", trigger: "blur" }],
      },
    };
  },
  mounted() {},

  computed: {
    feeIdRegionidChange() {
      const { feeId, regionid } = this;
      return { feeId: this.submitParams.feeId, regionid: this.submitParams.regionid };
    },
    ...mapGetters(["globalBusData"]),
  },

  created() {
    this.$set(this.submitParams, "sender", this.globalBusData.cnapsBrno);
    this.$set(this.submitParams, "senderName", this.globalBusData.cnapsBrname);
  },

  watch: {
    globalBusData: {
      handler(val) {
        this.$set(this.submitParams, "sender", val.cnapsBrno);
        this.$set(this.submitParams, "senderName", val.cnapsBrname);
      },
      deep: true,
      immediate: true,
    },
    feeIdRegionidChange: {
      handler(val) {
        let regionid = val.regionid;
        let feeId = val.feeId;
        console.log(regionid);
        if (feeId === "06907" && regionid === "530100") {
          this.$set(this.rules.billType[0], "required", true);
          this.$set(this.rules.billChkInfo[0], "required", true);
          this.$set(this.rules.billNum[0], "required", false);
          this.$set(this.submitParams, "billNum", "0");
        } else {
          this.$set(this.rules.billType[0], "required", false);
          this.$set(this.rules.billChkInfo[0], "required", false);
          this.$set(this.rules.billNum[0], "required", true);
          this.$set(
            this.submitParams,
            "billNum",
            this.detailList.length === 0 ? "" : this.detailList.length
          );
        }

        if ((feeId === "06901" || val === "06902") && regionid === "440100") {
          this.$set(this.rules.paymentInqType[0], "required", true);
        } else {
          this.$set(this.rules.paymentInqType[0], "required", false);
        }
      },
    },

    "submitParams.paymentInqType": {
      handler(val) {
        if (val === "QT00") {
          this.QT00disable = false;
          this.$set(this.rules.insuranceCode[0], "required", true);
        } else {
          this.QT00disable = true;
          this.$set(this.rules.insuranceCode[0], "required", false);
        }
        if (val === "QT01") {
          this.QT01disable = false;
          this.visibleHiden = "";
          this.$set(this.rules.oriPkgId[0], "required", true);
          this.$set(this.rules.oriSender[0], "required", true);
          this.$set(this.rules.oriMsgType[0], "required", true);
        } else {
          this.QT01disable = true;
          this.visibleHiden = "none";
          this.$set(this.rules.oriPkgId[0], "required", false);
          this.$set(this.rules.oriSender[0], "required", false);
          this.$set(this.rules.oriMsgType[0], "required", false);
        }
        if (val === "QT02") {
          this.QT02disable = false;
          this.$set(this.rules.orgId[0], "required", true);
          this.$set(this.rules.taxPayerCode[0], "required", true);
        } else {
          this.QT02disable = true;
          this.$set(this.rules.orgId[0], "required", false);
          this.$set(this.rules.taxPayerCode[0], "required", false);
        }
      },
    },
  },
  methods: {
    //行名行号查询
    openBankBranchDialog(fromFlag = "") {
      this.$refs.bankBranchDialog.show(fromFlag);
    },
    /** 提交按钮 */
    submitForm: function () {
      this.$refs["submitParams"].validate((valid) => {
        if (valid) {
          this.loading = true;
          this.$set(this.submitParams,"billInfo",this.detailList)
          activePaymentManagementMessageEntrySave(this.submitParams)
            .then((res) => {
              this.msgSuccess("录入成功");
              this.$alert(`CORE_ID: ${res.result.rspId}`, "生成交易流水号", {
                confirmButtonText: "确定",
                callback: (action) => {
                },
              });
              this.refresh();
              this.loading = false;
            })
            .catch((err) => {
              this.loading = false;
            });
        }
      });
    },
    //点击重置按钮
    refresh() {
      this.detailList = [];
      this.resetForm("submitParams");
      this.$set(this.$refs.dataTable, "dataList", []);
      this.$set(this.submitParams,"regionidDesc","")
    },

    //行名行号返回
    confirmBankBranch(fromFlag, row) {
      if (fromFlag === "indirectRecver") {
        this.$set(this.submitParams, "indirectRecver", row.bankCode);
        this.$set(this.submitParams, "indirectRecverName", row.orgFullname);
      }
    },

    checkbankcode(fromFlag) {
      if (fromFlag === "indirectRecver") {
        let indirectRecver = this.submitParams.indirectRecver;
        getBankInfByBankCode(oriSender)
          .then((response) => {
            if (response.code == "S" && response.result !== null && response.result !== undefined) {
              this.$set(this.submitParams, "indirectRecver", response.result.bankCode);
              this.$set(this.submitParams, "indirectRecverName", response.result.orgFullname);
            } else {
              this.msgError("无行名行号记录");
              this.$set(this.submitParams, "indirectRecver", null);
              this.$set(this.submitParams, "indirectRecverName", null);
            }
          })
          .catch((err) => {
            this.$set(this.submitParams, "indirectRecver", null);
            this.$set(this.submitParams, "indirectRecverName", null);
          });
      }
    },

    openBasedataDialog(dataType = "") {
      this.$refs.basedataDialog.show(dataType);
    },

    confirmData(fromFlag, row) {
      this.$set(this.submitParams, "regionid", row.dataValue);
      this.$set(this.submitParams, "regionidDesc", row.dataDesc);
    },

    //回车获取basedata值
    getbase(dataType) {
      const dataValue = this.submitParams.regionid;
      if (dataValue === "" || dataValue === null || dataValue === undefined) {
        return;
      }

      getBasedata(dataType, dataValue)
        .then((response) => {
          if (response.code == "S" && response.result !== null) {
            this.$set(this.submitParams, "regionid", response.result.dataValue);
            this.$set(this.submitParams, "regionidDesc", response.result.dataDesc);
          } else {
            this.msgSuccess("找不到对应的字典项");
            this.$set(this.submitParams, "regionid", null);
            this.$set(this.submitParams, "regionidDesc", null);
          }
        })
        .catch((err) => {
          this.$set(this.submitParams, "regionid", null);
          this.$set(this.submitParams, "regionidDesc", null);
        });
    },

    remove(row, index) {
      let delIndex = (this.currentPage-1) * this.pageSize + index;
      this.detailList.splice(delIndex, 1);
      this.$refs.dataTable.dataList = this.detailList
      if(index === 0 && this.currentPage !== 1){
        this.handleCurrentChange(this.currentPage-1);
      }else {
        this.handleCurrentChange(this.currentPage);
      }
      this.$set(
        this.submitParams,
        "billNum",
        this.detailList.length === 0 ? "" : this.detailList.length
      );
    },

    addRow() {
      let billCode = this.submitParams.billCode;
      if (billCode === "" || billCode === undefined) {
        this.$message.error("请输入账单编号");
        return;
      }
      let list = {
        billCode: this.submitParams.billCode,
        billCurcd: this.submitParams.billCurcd,
        billAmt: this.submitParams.billAmt,
      };

      this.$refs.dataTable.dataList.push(list);
      this.detailList.push(list);

      this.$set(this.submitParams, "billCode", undefined);
      this.$set(this.submitParams, "billCurcd", "CNY");
      this.$set(this.submitParams, "billAmt", undefined);
      this.$set(
        this.submitParams,
        "billNum",
        this.detailList.length === 0 ? "" : this.detailList.length
      );
      this.handleCurrentChange(this.currentPage);
    },

    confirmdetailQT00(row) {
      this.$set(this.submitParams, "oriPkgId", row.pkgId);
      this.$set(this.submitParams, "oriSender", row.directSender);
      this.$set(this.submitParams, "oriMsgType", row.msgType);
    },

    //行名行号查询
    opendetailQT00() {
      this.$set(this.formData, "feeId", this.submitParams.feeId);
      this.$set(this.formData, "uniformScCode", this.submitParams.uniformScCode);
      this.$set(this.formData, "custId", this.submitParams.custId);
      this.$set(this.formData, "paymentInqType", this.submitParams.paymentInqType);
      this.$refs.detailQT00Dialog.show();
    },

    //前端分页方法
    //切换每页显示数据量时的回调
    handleSizeChange(size) {
      this.pageSize = size;
      this.handleCurrentChange(this.currentPage);
    },
    handleCurrentChange(currentPage) {
      let page = this.detailList.slice((currentPage-1)*this.pageSize,currentPage*this.pageSize);
      this.$refs.dataTable.dataList = page
      this.currentPage = currentPage;
    },


  },
};
</script>
